//
//  PSConfirmation.h
//  PrefCore
//
//  Created by Sergey on 2/3/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PSBid.h"
#import "PSGame.h"
#import "PSGameSettings.h"

/// Function pointer type for processing a game confirmation.
/// @param gc Confirmation preference of the user.
/// @param game The game object representing the state of the play.
/// @param settings The setting object representing user settings.
/// @param bid The bid being made by the user.
/// @return YES if the bid needs to be confirmed; NO otherwise.
typedef BOOL (*PSCheckConfirmation)(PSGameConfirmation gc, PSGame* game, PSGameSettings* settings, PSBid* bid);

/// Checks if a confirmation of a play is required, baed on the current settings and the state of the game.
/// @param gc Confirmation preference of the user.
/// @param game The game object representing the state of the play.
/// @param settings The setting object representing user settings.
/// @param bid The bid being made by the user.
/// @return YES if the bid needs to be confirmed; NO otherwise.
BOOL PSConfirmPlay(PSGameConfirmation confirmation, PSGame* game, PSGameSettings* settings, PSBid* bid);

/// Checks if a confirmation of a pass is required, baed on the current settings and the state of the game.
/// @param gc Confirmation preference of the user.
/// @param game The game object representing the state of the play.
/// @param settings The setting object representing user settings.
/// @param bid The bid being made by the user.
/// @return YES if the bid needs to be confirmed; NO otherwise.
BOOL PSConfirmPass(PSGameConfirmation confirmation, PSGame* game, PSGameSettings* settings, PSBid* bid);

/// Checks if a confirmation of a misere is required, baed on the current settings and the state of the game.
/// @param gc Confirmation preference of the user.
/// @param game The game object representing the state of the play.
/// @param settings The setting object representing user settings.
/// @param bid The bid being made by the user.
/// @return YES if the bid needs to be confirmed; NO otherwise.
BOOL PSConfirmMisere(PSGameConfirmation confirmation, PSGame* game, PSGameSettings* settings, PSBid* bid);

/// Checks if a confirmation of a without three is required, baed on the current settings and the state of the game.
/// @param gc Confirmation preference of the user.
/// @param game The game object representing the state of the play.
/// @param settings The setting object representing user settings.
/// @param bid The bid being made by the user.
/// @return YES if the bid needs to be confirmed; NO otherwise.
BOOL PSConfirmWithoutThree(PSGameConfirmation confirmation, PSGame* game, PSGameSettings* settings, PSBid* bid);

/// Checks if a confirmation of a selected contract is required, baed on the current settings and the state of the game.
/// @param gc Confirmation preference of the user.
/// @param game The game object representing the state of the play.
/// @param settings The setting object representing user settings.
/// @param bid The bid being made by the user.
/// @return YES if the bid needs to be confirmed; NO otherwise.
BOOL PSConfirmContract(PSGameConfirmation confirmation, PSGame* game, PSGameSettings* settings, PSBid* bid);
